package com.cmy.debug_tools

import android.content.Intent
import android.os.Bundle
import android.view.View
import androidx.preference.EditTextPreference
import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat
import androidx.preference.PreferenceManager
import com.cmy.debug_tools.databinding.FragmentDebugToolsBinding
import com.cmy.framework_base.basics.BasicsFragment
import com.cmy.framework_network.environment.EnvironmentActivity
import java.io.BufferedReader
import java.io.InputStreamReader

/**
 * @name:
 *  DebugToolsFragment
 * @package:
 *  com.cmy.debug_tools
 * @date:
 *  2023/2/2216:31
 * @author
 *    cmy
 * @description
 *
 */
class DebugToolsFragment : BasicsFragment() {

    private val binding by lazy { FragmentDebugToolsBinding.inflate(layoutInflater)}

    override fun getContentView(): View = binding.root
    override fun initView(bundle: Bundle?) {

        binding.llNet.setOnClickListener {
            startActivity(Intent(requireActivity(), EnvironmentActivity::class.java))
        }


    }

    override fun initData() {

    }

    override fun onResume() {
        super.onResume()

        binding.tvNetState.text = if(EnvironmentActivity.isOfficialEnvironment(requireActivity()))  "当前为正式环境" else  "当前为测式环境"
    }
}